<?php
namespace Admin\Controller;
use Think\Controller;
use Login;
class AdminController extends Controller {
    public function admin(){
        //$this->loginSkip();
        //var_dump(cookie("session_id"));exit();
        isMyCookie();
        isLogin();
        //var_dump(session('session_id'));exit();
        $Info=D('Home/Info');
        
        
        $field=$Info->getInfoField();
        
        
        
        $count=$Info->count();
        $Page=getMyPage($count,10);
        $show=$Page->show();
        $list=$Info->field($field)->order('edate desc')->limit($Page->firstRow.','.$Page->listRows)->select();
        //$list['checkstate']==1?$list['checkstate']="已审核":$list['checkstate']="未审核";
        //var_dump($list);exit;
        //$this->assign('username',session('username'));
        $this->assign('page',$show);
        $this->assign('list',$list);
        
        $this->display();
    }
        
//     public  function loginSkip()
//         {
//             if (session('?sesion_id')) {
//                 // 设置成功后跳转页面的地址，默认的返回页面是$_SERVER['HTTP_REFERER']
//                 $this->success('登录成功', __MODULE__.'/Admin/admin');
//             } else {
//                 // 错误页面的默认跳转页面是返回前一页，通常不需要设置
//                 $this->error('请先登录', __ROOT__.'/login.php');
//             }
//         }
}